package org.csu.canteen.persistence;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.csu.canteen.entity.Category;
import org.csu.canteen.entity.Product;
import org.csu.canteen.vo.ProductVO;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ProductMapper extends BaseMapper<Product> {
    @Select("SELECT * FROM product WHERE category = #{categoryId}")
    List<ProductVO> findProductsByCategory(@Param("categoryId") String categoryId);
}
